﻿using PlayerRoles;
using System;
using System.Collections.Generic;

namespace RgCore.RoleAssignment
{
    public class RoleReservation
    {
        public RoleReservation(string userid, RoleTypeId role)
        {
            UserId = userid;
            RoleType = role;
        }

        public event Action<string> OnFailed;

        public event Action<string> OnSuccess;

        public static List<RoleReservation> Reservations { get; set; } = new List<RoleReservation>();
        public string UserId { get; }
        public RoleTypeId RoleType { get; }

        public void Failed()
        {
            OnFailed?.Invoke(UserId);
        }

        public void Success()
        {
            OnSuccess?.Invoke(UserId);
        }
    }
}